<template>
	<view>
		<uni-nav-bar left-icon="left"    :statusBar="true" titleSize="30px" leftText="返回"  right-text="修改" @clickRight="editFn"   title="问题详情"  @clickLeft="back"   :fixed="true" backgroundColor="#3286ed" color="#fff"/>
		<u--form class="form" labelPosition="left" labelWidth="120px" :model="formData" ref="form">
			<u-form-item   label="厂商:" prop="modelName" borderBottom ref="item1"  >
				<u--input  v-model="formData.modelName" border="none" placeholder="厂商"></u--input>
			<!-- <u--text v-if="formData.modelName=='1'" text="德业"></u--text>
			<u--text v-if="formData.modelName=='2'" text="川泰"></u--text> -->
			<u-icon slot="right" name="arrow-right"></u-icon>
			</u-form-item>
			<u-form-item    label="产品:" prop="machineType" borderBottom ref="item1"  >
				<u--input  v-model="formData.machineType" border="none" placeholder="产品"></u--input>
			<u-icon slot="right" name="arrow-right"></u-icon>
			</u-form-item>
			<u-form-item    label="型号:" prop="model" borderBottom ref="item1"  >
				<u--input  v-model="formData.model" border="none" placeholder="型号"></u--input>
			<u-icon slot="right" name="arrow-right"></u-icon>
			</u-form-item>
			<u-form-item  label="故障代码:" prop="faultCodes" borderBottom ref="item1"  >
				<u--input  v-model="formData.faultCodes" border="none" placeholder="故障代码"></u--input>
			</u-form-item>
			<u-form-item  label="维修内容:" prop="repairContent" borderBottom ref="item1"  >
				<u--textarea  v-model="formData.repairContent" border="none" placeholder="维修内容"></u--textarea>
			</u-form-item>
			<u-form-item  label="机器正面照:" prop="frontPhoto" borderBottom ref="item1"  >
				
			</u-form-item>
			<view class="">
				<a :href="`http://101.132.141.5:8081${formData.frontPhoto}`">
				    <u--image   :showLoading="true" :src="`http://101.132.141.5:8081${formData.frontPhoto}`" width="150px" height="150px"></u--image>
				</a>
			</view>
			<u-form-item  label="机器屏幕照片:" prop="screenPhotos" borderBottom ref="item1"  >
			
			</u-form-item>
			<view class="">
				<a :href="`http://101.132.141.5:8081${formData.screenPhotos}`">
				    <u--image   :showLoading="true" :src="`http://101.132.141.5:8081${formData.screenPhotos}`" width="150px" height="150px"></u--image>
				</a>
			</view>
			
			<u-form-item  label="机器主板照片:" prop="motherboardPhoto" borderBottom ref="item1"  >
				
			</u-form-item>
			<view class="">
				<a :href="`http://101.132.141.5:8081${formData.motherboardPhoto}`">
				    <u--image   :showLoading="true" :src="`http://101.132.141.5:8081${formData.motherboardPhoto}`" width="150px" height="150px"></u--image>
				</a>
			</view>
		 </u--form>
	</view>
</template>

<script>
	import {getQusttionInfo} from '@/api/question.js'
	export default {
		data(){
			return {
				 formData:{
					 frontPhoto:'',
					 screenPhotos:'',
					 motherboardPhoto:'',
				 },
				 e:{}
			}
		},
		onLoad(e) {
			this.e=e
			this.initData(e)
		},
		onPullDownRefresh(){
			this.initData(this.e)
			setTimeout(()=>{
				uni.stopPullDownRefresh()
			},1000)
		},
		methods:{
			async initData(e){
				let res= await getQusttionInfo(e.id)
				this.formData=res.data
				
			},
			back(){
				uni.navigateBack({delta:1})
			},
			editFn(){
				uni.navigateTo({
					url:'/pages/questions/addQuestions?id='+this.formData.id
				})
			}
		}
	}
</script>

<style lang="scss">
	.form{
		background-color: #fff;
		padding-left: 10px;
		padding-top: 10px;
	}
</style>